package com.localjoycommunity.cpdj.project.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.localjoycommunity.cpdj.project.system.domain.SysPaper;
import com.localjoycommunity.cpdj.project.system.domain.SysPaperQuestion;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 试卷Mapper接口
 *
 * @author leepandar
 * @date 2020-11-01
 */
public interface SysPaperMapper extends BaseMapper<SysPaper> {
    /**
     * 查询试卷
     *
     * @param paperId 试卷ID
     * @return 试卷
     */
    public SysPaper selectSysPaperById(Long paperId);

    /**
     * 查询试卷列表
     *
     * @param sysPaper 试卷
     * @return 试卷集合
     */
    public List<SysPaper> selectSysPaperList(SysPaper sysPaper);

    /**
     * 新增试卷
     *
     * @param sysPaper 试卷
     * @return 结果
     */
    public int insertSysPaper(SysPaper sysPaper);

    /**
     * 修改试卷
     *
     * @param sysPaper 试卷
     * @return 结果
     */
    public int updateSysPaper(SysPaper sysPaper);

    /**
     * 删除试卷
     *
     * @param paperId 试卷ID
     * @return 结果
     */
    public int deleteSysPaperById(Long paperId);

    /**
     * 批量删除试卷
     *
     * @param paperIds 需要删除的数据ID
     * @return 结果
     */
    public int deleteSysPaperByIds(Long[] paperIds);

    /**
     * 查询试卷试题中间表
     * @param paperId
     * @return
     */
    List<SysPaperQuestion> selectPaperQuestion(@Param("paperId") Long paperId);
}
